//*******************挂失部分*****************************************************
//获取挂失信息回调函数
function getLoosCardInfo(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='7' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var value=list[i].citizenCardNo+","+list[i].cardPName+","+list[i].paperTypeName+","+list[i].paperNo+","+list[i].customerName+","+list[i].lossTypeCode;
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td><input name='lossCard' onclick='test(this)' value="+value+" type='radio'></td><td>"+
					list[i].citizenCardNo+"</td><td>"+list[i].cardPName+"</td><td>"+list[i].customerName+"</td><td>"+
					list[i].paperTypeName+"</td><td>"+list[i].paperNo+"</td><td>"+list[i].cardStatusName+"</td></tr>"
				}
				
			}
			$("#lossCard").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByLossCard").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#getLossCardInfo'),getLoosCardInfo) id='previous' >上一页  </a><a href='#' onclick="+"next($('#getLossCardInfo'),getLoosCardInfo) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByLossCard").html(pagination);
			$("#paginationByLossCard").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","lossCard").attr("callback","getLoosCardInfo");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"lossCard",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:getLoosCardInfo
				});
			});
			var $p = $("#ByLossCard");
			initUI($p);
		});
	}
	
};



//验证checkBox
function validateChechBox6(){
	 if($("input[name='lossCard']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	 }
	 if($("input[name='lossCard']:checked").length > 1){
		 alertMsg.warn("不能多于一条数据！")
		 return false;
	 }
	
}

//************************************解挂部分************************************************************************************
//获取解挂信息回调函数
function getUnloosCardInfo(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='7' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var value=list[i].citizenCardNo+","+list[i].cardPName+","+list[i].paperTypeName+","+list[i].paperNo+","+list[i].customerName+","+list[i].lossTypeCode;
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td width='3%'><input name='unLossCard' onclick='test(this)' value="+value+" type='radio'></td><td width='10%'>"+
					list[i].citizenCardNo+"</td><td width='15%'>"+list[i].cardPName+"</td><td width='15%'>"+list[i].customerName+"</td><td width='15%'>"+
					list[i].paperTypeName+"</td><td width='19%'>"+list[i].paperNo+"</td><td width='10%'>"+list[i].cardStatusName+"</td><td width='13%'>"+list[i].lossCertNo+"</td></tr>"
				}
				
			}
			$("#unLossCard").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByUnlossCard").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#getUnloosCardInfo'),getUnloosCardInfo) id='previous' >上一页  </a><a href='#' onclick="+"next($('#getUnloosCardInfo'),getUnloosCardInfo) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByUnlossCard").html(pagination);
			$("#paginationByUnlossCard").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","unLossCard").attr("callback","getUnloosCardInfo");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"unLossCard",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:getUnloosCardInfo
				});
			});
		});
	}
	
};
//验证checkBox
function validateChechBox7(){
	 if($("input[name='unLossCard']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	 }
	 if($("input[name='unLossCard']:checked").length > 1){
		 alertMsg.warn("不能多于一条数据！")
		 return false;
	 }
	
}
//***********************************注销，退款********************************************************
//获取注销信息回调函数
function getCancelCardInfo(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			if(list.length==0){
				content+="<tr><td colspan='7' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var value=list[i].cardStatus+","+list[i].citizenCardNo+","+list[i].cardPName+","+list[i].cardTypeName+","+list[i].paperTypeName+","+list[i].paperNo+","+list[i].customerName;
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td><input name='cancelCard' onclick='test(this)' value="+value+" type='radio'></td><td>"+
					list[i].citizenCardNo+"</td><td>"+list[i].cardPName+"</td><td>"+list[i].cardTypeName+"</td><td>"+list[i].customerName+"</td><td>"+
					list[i].paperTypeName+"</td><td>"+list[i].paperNo+"</td><td>"+list[i].cardStatusName+"</td></tr>"
				}
				
			}
			$("#cancelCard").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByCancelCard").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#getCancelCardInfo'),getCancelCardInfo) id='previous' >上一页  </a><a href='#' onclick="+"next($('#getCancelCardInfo'),getCancelCardInfo) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByCancelCard").html(pagination);
			$("#paginationByCancelCard").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","cancelCard").attr("callback","getCancelCardInfo");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"cancelCard",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:getCancelCardInfo
				});
			});
			var $p = $("#ByCancelCard");
			initUI($p);
		});
	}
	
}
//拦截卡状态为正常，未读卡的操作
function validateChechBox8(){
	 if($("input[name='cancelCard']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	 }
	 if($("input[name='cancelCard']:checked").length > 1){
		 alertMsg.warn("不能多于一条数据！")
		 return false;
	 }
//	var isRead=$("input[name='isRead']").val();
//	var array;
//	$("input[name='cancelCard']:checked").each(function(n,item){
//		array=$(this).val().split(",");
//	})
//	if(isRead==""&& array[0]=="1"){
//		 alertMsg.warn("卡状态为正常，请先测试卡是否可读");
//		return false;
//	}
//	if(array[0]!="1"){//正式挂失设置卡不可读状态
//		$("input[name='isRead']").val("2");
//	}	
}

//获取注销退款的回调函数**********************************************************************************************
function getCancelRefundInfo(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			if(list.length==0){
				content+="<tr><td colspan='7' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var value=list[i].citizenCardNo+"#"+list[i].cardpCodeName+"#"+list[i].cardTypeName+"#"+list[i].customerName+"#"+list[i].paperTypeName+"#"+list[i].paperNo+"#"+list[i].cardStatusName+"#"+list[i].logoutDate;
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td><input name='cancelCardReund' onclick='test(this)' value="+value+" type='radio'></td><td>"+
					list[i].citizenCardNo+"</td><td>"+list[i].cardpCodeName+"</td><td>"+list[i].cardTypeName+"</td><td>"+list[i].customerName+"</td><td>"+
					list[i].paperTypeName+"</td><td>"+list[i].paperNo+"</td><td>"+list[i].cardStatusName+"</td></tr>"
				}
				
			}
			$("#tobodyByCancelRefund").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByCancelRefund").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#getCancelCardInfo'),getCancelCardInfo) id='previous' >上一页  </a><a href='#' onclick="+"next($('#getCancelCardInfo'),getCancelCardInfo) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByCancelCard").html(pagination);
			$("#paginationByCancelRefund").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","cancelCard").attr("callback","getCancelCardInfo");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tobodyByCancelRefund",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:getCancelRefundInfo
				});
			});
			var $p = $("#ByCancelRefund");
			initUI($p);
		});
	}
	
}

function validateChechBoxByCancelRefund(){
	 if($("input[name='cancelCardReund']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	 }
	 if($("input[name='cancelCardReund']:checked").length > 1){
		 alertMsg.warn("不能多于一条数据！")
		 return false;
	 }
	
}
